import request from '@/utils/request';

// 根据筛选条件获取商品数量
export const getGoodsTotal = ({id,addMoneyBuy,stages})=>request.get(`/phonelist?goodsId=${id}${addMoneyBuy?"&isDiscount.addMoneyBuy=1" : ""}${stages?"&isDiscount.stages=1":""}`);

// 根据筛选条件获取商品分页列表
export const getPhoneList = ({id,page,limit,addMoneyBuy,stages,saleNumOrder,priceOrder})=>{
  return request.get(`/phonelist?goodsId=${id}&_page=${page}&_limit=${limit}${addMoneyBuy?"&isDiscount.addMoneyBuy=1" : ""}${stages?"&isDiscount.stages=1":""}${saleNumOrder?"&_sort=saleNum":""}${saleNumOrder?'':priceOrder?"&_sort=goodsList[0].price&_order=desc":"&_sort=goodsList[0].price&_order=asc"}`);
}


